package com.voc.im.bean;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class ChatRecord {

    private IntegerProperty id;

    private IntegerProperty uid;

    private StringProperty body;

    public ChatRecord(String body) {
        setId(0);
        setUid(0);
        setBody(body);
    }

    public ChatRecord(int id, int uid,String body) {
        setId(id);
        setUid(uid);
        setBody(body);
    }

    public int getId() {
        return idProperty().get();
    }

    public IntegerProperty idProperty() {
        if (id == null) {
            id = new SimpleIntegerProperty();
        }
        return id;
    }

    public void setId(int id) {
        this.idProperty().set(id);
    }
    public int getUid() {
        return uidProperty().get();
    }

    public IntegerProperty uidProperty() {
        if (uid == null) {
            uid = new SimpleIntegerProperty();
        }
        return uid;
    }

    public void setUid(int uid) {
        this.uidProperty().set(uid);
    }

    public String getBody() {
        return body.get();
    }

    public StringProperty bodyProperty() {
        if (body == null) {
            body = new SimpleStringProperty();
        }
        return body;
    }

    public void setBody(String nickname) {
        this.bodyProperty().set(nickname);
    }

    public void set(ChatRecord chatRecord){
        setId(chatRecord.getId());
        setUid(chatRecord.getUid());
        setBody(chatRecord.getBody());
    }
}
